from scrapy import cmdline
from testifyAvailable import TestifyAvailable
import schedule
import time

def runCMD():
    cmdline.execute('scrapy crawl proxySpider'.split())


# 检查数据库ip有效性
schedule.every(30).minutes.do(TestifyAvailable().testifyDBIPAvailable)
# 运行爬虫
schedule.every(30).minutes.do(runCMD)
while True:
    schedule.run_pending()
    time.sleep(1)